{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# <center> Hyperparameter Tuning for Generative Adversarial Network (NLS-KDD) <center/>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Using TensorFlow backend.\n"
     ]
    }
   ],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "from sklearn.preprocessing import StandardScaler\n",
    "from sklearn.metrics import accuracy_score\n",
    "\n",
    "import utils , preprocessing , cgan , VannilaGan, wgan \n",
    "from matplotlib import pyplot as plt\n",
    "%matplotlib inline\n",
    "import tensorflow as tf\n",
    "from tensorflow.keras.layers import Dense, Input, Dropout\n",
    "from tensorflow.keras.models import Model\n",
    "from tensorflow.keras import backend as K\n",
    "from scipy.stats import norm\n",
    "from tensorflow.keras.losses import kullback_leibler_divergence"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Read Data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "train,test, label_mapping = preprocessing.get_data(encoding=\"Label\")\n",
    "\n",
    "data_cols = list(train.columns[ train.columns != 'label' ])\n",
    "x_train , x_test = preprocessing.preprocess(train,test,data_cols,\"Robust\",True)\n",
    "\n",
    "y_train = x_train.label.values\n",
    "y_test = x_test.label.values\n",
    "\n",
    "data_cols = list(x_train.columns[ x_train.columns != 'label' ])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "to_drop = preprocessing.get_contant_featues(x_train,data_cols)\n",
    "x_train.drop(to_drop, axis=1,inplace=True)\n",
    "x_test.drop(to_drop, axis=1,inplace=True)\n",
    "\n",
    "data_cols = list(x_train.columns[ x_train.columns != 'label' ])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Set Hyperparams"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "rand_dim = 32\n",
    "base_n_count = 100\n",
    "\n",
    "combined_ep = 2000\n",
    "batch_size = 128 if len(x) > 128 else len(x)\n",
    "\n",
    "ep_d = 1\n",
    "ep_g = 2\n",
    "learning_rate = 0.0001"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Generator & Discriminator Definitions"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_discrimnator(data_dim, min_num_neurones,n_layers, lr ,optimizer ,activation_f):\n",
    "    model = tf.keras.models.Sequential(name='Discriminator')\n",
    "    \n",
    "    model.add(Dense(min_num_neurones*n_layers, activation=activation_f,input_dim = data_dim))\n",
    "    for n in reversed(range(1,n_layers)):\n",
    "        model.add(Dense(n*min_num_neurones, activation = activation_f))\n",
    "        \n",
    "    model.add(Dense(1,activation=\"sigmoid\"))\n",
    "    \n",
    "    model.compile(loss='binary_crossentropy', optimizer=optimizer)\n",
    "    K.set_value(model.optimizer.lr, lr)\n",
    "    \n",
    "    return model\n",
    "\n",
    "def get_generator(data_dim, min_num_neurones,noise_dim,n_layers, lr ,optimizer ,activation_f):\n",
    "    model = tf.keras.models.Sequential(name='Generator')\n",
    "    \n",
    "    model.add(Dense(min_num_neurones, activation=activation_f,input_dim = noise_dim ))\n",
    "    for n in range(1,n_layers):\n",
    "        model.add(Dense(n*min_num_neurones, activation = activation_f))\n",
    "        \n",
    "    model.add(Dense(data_dim,activation=activation_f))\n",
    "    \n",
    "    model.compile(loss='binary_crossentropy', optimizer=optimizer)\n",
    "    K.set_value(model.optimizer.lr, lr)\n",
    "    \n",
    "    return model\n",
    "\n",
    "def create_gan(discriminator, generator, z_dim):\n",
    "    discriminator.trainable=False\n",
    "    gan_input = Input(shape=(z_dim,))\n",
    "    \n",
    "    gan_output = discriminator(generator(gan_input))\n",
    "    gan= Model(inputs = gan_input, outputs = gan_output)\n",
    "    gan.compile(loss='binary_crossentropy', optimizer='sgd')\n",
    "    return gan"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_batch(X, batch_size=1):\n",
    "    batch_ix = np.random.choice(len(X), batch_size, replace=False)\n",
    "    return X[batch_ix]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "def training1(arguments,X):\n",
    "    K.clear_session()\n",
    "    \n",
    "    [rand_noise_dim, nb_steps, batch_size,D_epochs, G_epochs, min_num_neurones, lr, n_layers ,optimizer ,activation_f ] = arguments\n",
    "    \n",
    "    data_dim = X.shape[1]\n",
    "    combined_loss, disc_loss_generated, disc_loss_real = [], [], []\n",
    "    \n",
    "    # Creating GAN\n",
    "    generator = get_generator(data_dim, min_num_neurones,rand_noise_dim,n_layers, lr ,optimizer ,activation_f)\n",
    "    discriminator = get_discrimnator(data_dim, min_num_neurones,n_layers, lr ,optimizer ,activation_f)\n",
    "    adversarial_model = create_gan(discriminator, generator,rand_noise_dim)\n",
    "    \n",
    "    print(generator.summary())\n",
    "    print(discriminator.summary())\n",
    "    print(adversarial_model.summary())\n",
    "    \n",
    "    #print(\"batch_size : \", batch_size)\n",
    "    #print(\"rand_dim : \",rand_dim)\n",
    "    #Start training\n",
    "    for epoch in range(1,nb_steps + 1 ):\n",
    "        K.set_learning_phase(1)\n",
    "        \n",
    "        #Train Discriminator\n",
    "        discriminator.trainable=True\n",
    "        for i in range(D_epochs):\n",
    "            np.random.seed(i+epoch)\n",
    "        \n",
    "            noise = np.random.normal(0,1, size=(batch_size, rand_noise_dim))\n",
    "            generated_samples = generator.predict(noise)\n",
    "            real_samples = get_batch(X,batch_size)\n",
    "            \n",
    "            d_l_r = discriminator.train_on_batch(real_samples, np.random.uniform(low=0.999, high=1.0, size=batch_size))\n",
    "            d_l_g = discriminator.train_on_batch(generated_samples, np.random.uniform(low=0.0, high=0.0001, size=batch_size))\n",
    "        \n",
    "        #Freeze Discriminator\n",
    "        #print(\"D lr : {}\".format(discriminator.optimizer.get_config()['lr']))\n",
    "        discriminator.trainable = False\n",
    "        disc_loss_generated.append(d_l_g)\n",
    "        disc_loss_real.append(d_l_r)\n",
    "        \n",
    "        #Train Generator\n",
    "        for i in range(G_epochs):\n",
    "            np.random.seed(i+epoch)\n",
    "            \n",
    "            noise = np.random.normal(0,1, size = (batch_size, rand_noise_dim))\n",
    "            loss = adversarial_model.train_on_batch(noise, np.random.uniform(low=0.999, high=1.0, size=batch_size))\n",
    "            \n",
    "        combined_loss.append(loss)\n",
    "        \n",
    "        #Do checkpointing\n",
    "        if epoch % 10 == 0:\n",
    "            K.set_learning_phase(0)\n",
    "            test_size = len(X)\n",
    "            \n",
    "            z = np.random.normal(3,2,size=(test_size, rand_noise_dim))\n",
    "\n",
    "            fake_pred = np.array(adversarial_model.predict(z)).ravel()\n",
    "            real_pred = np.array(discriminator.predict(X)).ravel()\n",
    "\n",
    "            modelAccuracy(fake_pred,real_pred)\n",
    "        \n",
    "    return dict({\"generator_model\":generator,\"discriminator_model\":discriminator,\\\n",
    "            \"combined_model\":adversarial_model,\"generator_loss\":combined_loss,\\\n",
    "            \"disc_loss_generated\":disc_loss_generated,\"disc_loss_real\": disc_loss_real})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "att_ind = np.where(train.label == label_mapping[\"probe\"])[0]\n",
    "\n",
    "x = x_train[att_ind]\n",
    "\n",
    "# rand_dim = 32\n",
    "# base_n_count = 100\n",
    "# batch_size = 128 if len(x) > 128 else len(x)\n",
    "# combined_ep = 100\n",
    "# learning_rate = 0.0001\n",
    "\n",
    "rand_dim = np.arange(10,110,10)\n",
    "base_n_count = np.arange(3,41,3)\n",
    "ephocs = np.arange(100,5000,100)\n",
    "batch_sizes = [64,128,250,300,350]\n",
    "learning_rates = np.logspace(-1,-4,num=10)\n",
    "\n",
    "optimizers = [\"sgd\", \"RMSprop\", \"adam\", \"Adagrad\", \"Adamax\",\"Nadam\"]\n",
    "activation_func = [\"tanh\",\"relu\",\"softplus\",\"linear\",\"elu\"]\n",
    "\n",
    "ep_d = 1\n",
    "ep_g = 1"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Test"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "from collections import defaultdict"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "WARNING:tensorflow:From /usr/local/lib/python3.6/site-packages/tensorflow/python/ops/resource_variable_ops.py:435: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Colocations handled automatically by placer.\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "dense (Dense)                (None, 50)                1650      \n",
      "_________________________________________________________________\n",
      "dense_1 (Dense)              (None, 50)                2550      \n",
      "_________________________________________________________________\n",
      "dense_2 (Dense)              (None, 100)               5100      \n",
      "_________________________________________________________________\n",
      "dense_3 (Dense)              (None, 150)               15150     \n",
      "_________________________________________________________________\n",
      "dense_4 (Dense)              (None, 41)                6191      \n",
      "=================================================================\n",
      "Total params: 30,641\n",
      "Trainable params: 30,641\n",
      "Non-trainable params: 0\n",
      "_________________________________________________________________\n",
      "None\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "dense_5 (Dense)              (None, 200)               8400      \n",
      "_________________________________________________________________\n",
      "dense_6 (Dense)              (None, 150)               30150     \n",
      "_________________________________________________________________\n",
      "dense_7 (Dense)              (None, 100)               15100     \n",
      "_________________________________________________________________\n",
      "dense_8 (Dense)              (None, 50)                5050      \n",
      "_________________________________________________________________\n",
      "dense_9 (Dense)              (None, 1)                 51        \n",
      "=================================================================\n",
      "WARNING:tensorflow:Discrepancy between trainable weights and collected trainable weights, did you set `model.trainable` without calling `model.compile` after ?\n",
      "Total params: 117,502\n",
      "Trainable params: 58,751\n",
      "Non-trainable params: 58,751\n",
      "_________________________________________________________________\n",
      "None\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "input_1 (InputLayer)         (None, 32)                0         \n",
      "_________________________________________________________________\n",
      "Generator (Sequential)       (None, 41)                30641     \n",
      "_________________________________________________________________\n",
      "Discriminator (Sequential)   (None, 1)                 58751     \n",
      "=================================================================\n",
      "Total params: 89,392\n",
      "Trainable params: 30,641\n",
      "Non-trainable params: 58,751\n",
      "_________________________________________________________________\n",
      "None\n",
      "WARNING:tensorflow:From /usr/local/lib/python3.6/site-packages/tensorflow/python/ops/math_ops.py:3066: to_int32 (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Use tf.cast instead.\n",
      "Discriminator accuracy on Fake : 1.0, Real : 0.06708991077556624\n",
      "Discriminator accuracy on Fake : 1.0, Real : 0.4572752230610844\n",
      "Discriminator accuracy on Fake : 1.0, Real : 0.9336822237474263\n",
      "finished 0ne\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "dense (Dense)                (None, 50)                1650      \n",
      "_________________________________________________________________\n",
      "dense_1 (Dense)              (None, 50)                2550      \n",
      "_________________________________________________________________\n",
      "dense_2 (Dense)              (None, 100)               5100      \n",
      "_________________________________________________________________\n",
      "dense_3 (Dense)              (None, 150)               15150     \n",
      "_________________________________________________________________\n",
      "dense_4 (Dense)              (None, 41)                6191      \n",
      "=================================================================\n",
      "Total params: 30,641\n",
      "Trainable params: 30,641\n",
      "Non-trainable params: 0\n",
      "_________________________________________________________________\n",
      "None\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "dense_5 (Dense)              (None, 200)               8400      \n",
      "_________________________________________________________________\n",
      "dense_6 (Dense)              (None, 150)               30150     \n",
      "_________________________________________________________________\n",
      "dense_7 (Dense)              (None, 100)               15100     \n",
      "_________________________________________________________________\n",
      "dense_8 (Dense)              (None, 50)                5050      \n",
      "_________________________________________________________________\n",
      "dense_9 (Dense)              (None, 1)                 51        \n",
      "=================================================================\n",
      "Total params: 117,502\n",
      "Trainable params: 58,751\n",
      "Non-trainable params: 58,751\n",
      "_________________________________________________________________\n",
      "None\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "input_1 (InputLayer)         (None, 32)                0         \n",
      "_________________________________________________________________\n",
      "Generator (Sequential)       (None, 41)                30641     \n",
      "_________________________________________________________________\n",
      "Discriminator (Sequential)   (None, 1)                 58751     \n",
      "=================================================================\n",
      "Total params: 89,392\n",
      "Trainable params: 30,641\n",
      "Non-trainable params: 58,751\n",
      "_________________________________________________________________\n",
      "None\n",
      "Discriminator accuracy on Fake : 0.22640700068634179, Real : 0.9927934111187371\n",
      "Discriminator accuracy on Fake : 0.6795641729581332, Real : 0.9834420041180508\n",
      "Discriminator accuracy on Fake : 0.928448867536033, Real : 0.9641386410432395\n",
      "finished 0ne\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "dense (Dense)                (None, 50)                1650      \n",
      "_________________________________________________________________\n",
      "dense_1 (Dense)              (None, 50)                2550      \n",
      "_________________________________________________________________\n",
      "dense_2 (Dense)              (None, 100)               5100      \n",
      "_________________________________________________________________\n",
      "dense_3 (Dense)              (None, 150)               15150     \n",
      "_________________________________________________________________\n",
      "dense_4 (Dense)              (None, 41)                6191      \n",
      "=================================================================\n",
      "Total params: 30,641\n",
      "Trainable params: 30,641\n",
      "Non-trainable params: 0\n",
      "_________________________________________________________________\n",
      "None\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "dense_5 (Dense)              (None, 200)               8400      \n",
      "_________________________________________________________________\n",
      "dense_6 (Dense)              (None, 150)               30150     \n",
      "_________________________________________________________________\n",
      "dense_7 (Dense)              (None, 100)               15100     \n",
      "_________________________________________________________________\n",
      "dense_8 (Dense)              (None, 50)                5050      \n",
      "_________________________________________________________________\n",
      "dense_9 (Dense)              (None, 1)                 51        \n",
      "=================================================================\n",
      "Total params: 117,502\n",
      "Trainable params: 58,751\n",
      "Non-trainable params: 58,751\n",
      "_________________________________________________________________\n",
      "None\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "input_1 (InputLayer)         (None, 32)                0         \n",
      "_________________________________________________________________\n",
      "Generator (Sequential)       (None, 41)                30641     \n",
      "_________________________________________________________________\n",
      "Discriminator (Sequential)   (None, 1)                 58751     \n",
      "=================================================================\n",
      "Total params: 89,392\n",
      "Trainable params: 30,641\n",
      "Non-trainable params: 58,751\n",
      "_________________________________________________________________\n",
      "None\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Discriminator accuracy on Fake : 0.0, Real : 1.0\n",
      "Discriminator accuracy on Fake : 0.0, Real : 1.0\n",
      "Discriminator accuracy on Fake : 0.0, Real : 1.0\n",
      "finished 0ne\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "dense (Dense)                (None, 50)                1650      \n",
      "_________________________________________________________________\n",
      "dense_1 (Dense)              (None, 50)                2550      \n",
      "_________________________________________________________________\n",
      "dense_2 (Dense)              (None, 100)               5100      \n",
      "_________________________________________________________________\n",
      "dense_3 (Dense)              (None, 150)               15150     \n",
      "_________________________________________________________________\n",
      "dense_4 (Dense)              (None, 41)                6191      \n",
      "=================================================================\n",
      "Total params: 30,641\n",
      "Trainable params: 30,641\n",
      "Non-trainable params: 0\n",
      "_________________________________________________________________\n",
      "None\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "dense_5 (Dense)              (None, 200)               8400      \n",
      "_________________________________________________________________\n",
      "dense_6 (Dense)              (None, 150)               30150     \n",
      "_________________________________________________________________\n",
      "dense_7 (Dense)              (None, 100)               15100     \n",
      "_________________________________________________________________\n",
      "dense_8 (Dense)              (None, 50)                5050      \n",
      "_________________________________________________________________\n",
      "dense_9 (Dense)              (None, 1)                 51        \n",
      "=================================================================\n",
      "Total params: 117,502\n",
      "Trainable params: 58,751\n",
      "Non-trainable params: 58,751\n",
      "_________________________________________________________________\n",
      "None\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "input_1 (InputLayer)         (None, 32)                0         \n",
      "_________________________________________________________________\n",
      "Generator (Sequential)       (None, 41)                30641     \n",
      "_________________________________________________________________\n",
      "Discriminator (Sequential)   (None, 1)                 58751     \n",
      "=================================================================\n",
      "Total params: 89,392\n",
      "Trainable params: 30,641\n",
      "Non-trainable params: 58,751\n",
      "_________________________________________________________________\n",
      "None\n",
      "Discriminator accuracy on Fake : 0.9999142072752231, Real : 0.9963109128345916\n",
      "Discriminator accuracy on Fake : 0.40468428277282087, Real : 0.962079615648593\n",
      "Discriminator accuracy on Fake : 0.002144818119423473, Real : 0.9560741249142073\n",
      "finished 0ne\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "dense (Dense)                (None, 50)                1650      \n",
      "_________________________________________________________________\n",
      "dense_1 (Dense)              (None, 50)                2550      \n",
      "_________________________________________________________________\n",
      "dense_2 (Dense)              (None, 100)               5100      \n",
      "_________________________________________________________________\n",
      "dense_3 (Dense)              (None, 150)               15150     \n",
      "_________________________________________________________________\n",
      "dense_4 (Dense)              (None, 41)                6191      \n",
      "=================================================================\n",
      "Total params: 30,641\n",
      "Trainable params: 30,641\n",
      "Non-trainable params: 0\n",
      "_________________________________________________________________\n",
      "None\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "dense_5 (Dense)              (None, 200)               8400      \n",
      "_________________________________________________________________\n",
      "dense_6 (Dense)              (None, 150)               30150     \n",
      "_________________________________________________________________\n",
      "dense_7 (Dense)              (None, 100)               15100     \n",
      "_________________________________________________________________\n",
      "dense_8 (Dense)              (None, 50)                5050      \n",
      "_________________________________________________________________\n",
      "dense_9 (Dense)              (None, 1)                 51        \n",
      "=================================================================\n",
      "Total params: 117,502\n",
      "Trainable params: 58,751\n",
      "Non-trainable params: 58,751\n",
      "_________________________________________________________________\n",
      "None\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "input_1 (InputLayer)         (None, 32)                0         \n",
      "_________________________________________________________________\n",
      "Generator (Sequential)       (None, 41)                30641     \n",
      "_________________________________________________________________\n",
      "Discriminator (Sequential)   (None, 1)                 58751     \n",
      "=================================================================\n",
      "Total params: 89,392\n",
      "Trainable params: 30,641\n",
      "Non-trainable params: 58,751\n",
      "_________________________________________________________________\n",
      "None\n",
      "Discriminator accuracy on Fake : 0.0, Real : 0.9996568291008923\n",
      "Discriminator accuracy on Fake : 0.0, Real : 0.9993994509265615\n",
      "Discriminator accuracy on Fake : 0.0, Real : 0.9993994509265615\n",
      "finished 0ne\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "dense (Dense)                (None, 50)                1650      \n",
      "_________________________________________________________________\n",
      "dense_1 (Dense)              (None, 50)                2550      \n",
      "_________________________________________________________________\n",
      "dense_2 (Dense)              (None, 100)               5100      \n",
      "_________________________________________________________________\n",
      "dense_3 (Dense)              (None, 150)               15150     \n",
      "_________________________________________________________________\n",
      "dense_4 (Dense)              (None, 41)                6191      \n",
      "=================================================================\n",
      "Total params: 30,641\n",
      "Trainable params: 30,641\n",
      "Non-trainable params: 0\n",
      "_________________________________________________________________\n",
      "None\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "dense_5 (Dense)              (None, 200)               8400      \n",
      "_________________________________________________________________\n",
      "dense_6 (Dense)              (None, 150)               30150     \n",
      "_________________________________________________________________\n",
      "dense_7 (Dense)              (None, 100)               15100     \n",
      "_________________________________________________________________\n",
      "dense_8 (Dense)              (None, 50)                5050      \n",
      "_________________________________________________________________\n",
      "dense_9 (Dense)              (None, 1)                 51        \n",
      "=================================================================\n",
      "Total params: 117,502\n",
      "Trainable params: 58,751\n",
      "Non-trainable params: 58,751\n",
      "_________________________________________________________________\n",
      "None\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "input_1 (InputLayer)         (None, 32)                0         \n",
      "_________________________________________________________________\n",
      "Generator (Sequential)       (None, 41)                30641     \n",
      "_________________________________________________________________\n",
      "Discriminator (Sequential)   (None, 1)                 58751     \n",
      "=================================================================\n",
      "Total params: 89,392\n",
      "Trainable params: 30,641\n",
      "Non-trainable params: 58,751\n",
      "_________________________________________________________________\n",
      "None\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Discriminator accuracy on Fake : 0.6004632807137955, Real : 0.47777968428277284\n",
      "Discriminator accuracy on Fake : 0.5339739190116678, Real : 0.9572752230610844\n",
      "Discriminator accuracy on Fake : 0.4889327385037749, Real : 0.9936513383665065\n",
      "finished 0ne\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "dense (Dense)                (None, 50)                1650      \n",
      "_________________________________________________________________\n",
      "dense_1 (Dense)              (None, 50)                2550      \n",
      "_________________________________________________________________\n",
      "dense_2 (Dense)              (None, 100)               5100      \n",
      "_________________________________________________________________\n",
      "dense_3 (Dense)              (None, 150)               15150     \n",
      "_________________________________________________________________\n",
      "dense_4 (Dense)              (None, 41)                6191      \n",
      "=================================================================\n",
      "Total params: 30,641\n",
      "Trainable params: 30,641\n",
      "Non-trainable params: 0\n",
      "_________________________________________________________________\n",
      "None\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "dense_5 (Dense)              (None, 200)               8400      \n",
      "_________________________________________________________________\n",
      "dense_6 (Dense)              (None, 150)               30150     \n",
      "_________________________________________________________________\n",
      "dense_7 (Dense)              (None, 100)               15100     \n",
      "_________________________________________________________________\n",
      "dense_8 (Dense)              (None, 50)                5050      \n",
      "_________________________________________________________________\n",
      "dense_9 (Dense)              (None, 1)                 51        \n",
      "=================================================================\n",
      "Total params: 117,502\n",
      "Trainable params: 58,751\n",
      "Non-trainable params: 58,751\n",
      "_________________________________________________________________\n",
      "None\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "input_1 (InputLayer)         (None, 32)                0         \n",
      "_________________________________________________________________\n",
      "Generator (Sequential)       (None, 41)                30641     \n",
      "_________________________________________________________________\n",
      "Discriminator (Sequential)   (None, 1)                 58751     \n",
      "=================================================================\n",
      "Total params: 89,392\n",
      "Trainable params: 30,641\n",
      "Non-trainable params: 58,751\n",
      "_________________________________________________________________\n",
      "None\n",
      "Discriminator accuracy on Fake : 1.0, Real : 0.9981983527796843\n",
      "Discriminator accuracy on Fake : 1.0, Real : 0.9118908716540838\n",
      "Discriminator accuracy on Fake : 1.0, Real : 0.7836307481125601\n",
      "finished 0ne\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "dense (Dense)                (None, 50)                1650      \n",
      "_________________________________________________________________\n",
      "dense_1 (Dense)              (None, 50)                2550      \n",
      "_________________________________________________________________\n",
      "dense_2 (Dense)              (None, 100)               5100      \n",
      "_________________________________________________________________\n",
      "dense_3 (Dense)              (None, 150)               15150     \n",
      "_________________________________________________________________\n",
      "dense_4 (Dense)              (None, 41)                6191      \n",
      "=================================================================\n",
      "Total params: 30,641\n",
      "Trainable params: 30,641\n",
      "Non-trainable params: 0\n",
      "_________________________________________________________________\n",
      "None\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "dense_5 (Dense)              (None, 200)               8400      \n",
      "_________________________________________________________________\n",
      "dense_6 (Dense)              (None, 150)               30150     \n",
      "_________________________________________________________________\n",
      "dense_7 (Dense)              (None, 100)               15100     \n",
      "_________________________________________________________________\n",
      "dense_8 (Dense)              (None, 50)                5050      \n",
      "_________________________________________________________________\n",
      "dense_9 (Dense)              (None, 1)                 51        \n",
      "=================================================================\n",
      "Total params: 117,502\n",
      "Trainable params: 58,751\n",
      "Non-trainable params: 58,751\n",
      "_________________________________________________________________\n",
      "None\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "input_1 (InputLayer)         (None, 32)                0         \n",
      "_________________________________________________________________\n",
      "Generator (Sequential)       (None, 41)                30641     \n",
      "_________________________________________________________________\n",
      "Discriminator (Sequential)   (None, 1)                 58751     \n",
      "=================================================================\n",
      "Total params: 89,392\n",
      "Trainable params: 30,641\n",
      "Non-trainable params: 58,751\n",
      "_________________________________________________________________\n",
      "None\n",
      "Discriminator accuracy on Fake : 0.027968428277282086, Real : 0.9892759094028827\n",
      "Discriminator accuracy on Fake : 0.23661633493479753, Real : 0.9383150308853809\n",
      "Discriminator accuracy on Fake : 0.03903568977350721, Real : 0.8509780370624571\n",
      "finished 0ne\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "dense (Dense)                (None, 50)                1650      \n",
      "_________________________________________________________________\n",
      "dense_1 (Dense)              (None, 50)                2550      \n",
      "_________________________________________________________________\n",
      "dense_2 (Dense)              (None, 100)               5100      \n",
      "_________________________________________________________________\n",
      "dense_3 (Dense)              (None, 150)               15150     \n",
      "_________________________________________________________________\n",
      "dense_4 (Dense)              (None, 41)                6191      \n",
      "=================================================================\n",
      "Total params: 30,641\n",
      "Trainable params: 30,641\n",
      "Non-trainable params: 0\n",
      "_________________________________________________________________\n",
      "None\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "dense_5 (Dense)              (None, 200)               8400      \n",
      "_________________________________________________________________\n",
      "dense_6 (Dense)              (None, 150)               30150     \n",
      "_________________________________________________________________\n",
      "dense_7 (Dense)              (None, 100)               15100     \n",
      "_________________________________________________________________\n",
      "dense_8 (Dense)              (None, 50)                5050      \n",
      "_________________________________________________________________\n",
      "dense_9 (Dense)              (None, 1)                 51        \n",
      "=================================================================\n",
      "Total params: 117,502\n",
      "Trainable params: 58,751\n",
      "Non-trainable params: 58,751\n",
      "_________________________________________________________________\n",
      "None\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "input_1 (InputLayer)         (None, 32)                0         \n",
      "_________________________________________________________________\n",
      "Generator (Sequential)       (None, 41)                30641     \n",
      "_________________________________________________________________\n",
      "Discriminator (Sequential)   (None, 1)                 58751     \n",
      "=================================================================\n",
      "Total params: 89,392\n",
      "Trainable params: 30,641\n",
      "Non-trainable params: 58,751\n",
      "_________________________________________________________________\n",
      "None\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Discriminator accuracy on Fake : 1.0, Real : 0.0\n",
      "Discriminator accuracy on Fake : 1.0, Real : 0.2676733013040494\n",
      "Discriminator accuracy on Fake : 1.0, Real : 0.5106382978723404\n",
      "Discriminator accuracy on Fake : 1.0, Real : 0.6494509265614276\n",
      "Discriminator accuracy on Fake : 1.0, Real : 0.6920041180507893\n",
      "finished 0ne\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "dense (Dense)                (None, 50)                1650      \n",
      "_________________________________________________________________\n",
      "dense_1 (Dense)              (None, 50)                2550      \n",
      "_________________________________________________________________\n",
      "dense_2 (Dense)              (None, 100)               5100      \n",
      "_________________________________________________________________\n",
      "dense_3 (Dense)              (None, 150)               15150     \n",
      "_________________________________________________________________\n",
      "dense_4 (Dense)              (None, 41)                6191      \n",
      "=================================================================\n",
      "Total params: 30,641\n",
      "Trainable params: 30,641\n",
      "Non-trainable params: 0\n",
      "_________________________________________________________________\n",
      "None\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "dense_5 (Dense)              (None, 200)               8400      \n",
      "_________________________________________________________________\n",
      "dense_6 (Dense)              (None, 150)               30150     \n",
      "_________________________________________________________________\n",
      "dense_7 (Dense)              (None, 100)               15100     \n",
      "_________________________________________________________________\n",
      "dense_8 (Dense)              (None, 50)                5050      \n",
      "_________________________________________________________________\n",
      "dense_9 (Dense)              (None, 1)                 51        \n",
      "=================================================================\n",
      "Total params: 117,502\n",
      "Trainable params: 58,751\n",
      "Non-trainable params: 58,751\n",
      "_________________________________________________________________\n",
      "None\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "input_1 (InputLayer)         (None, 32)                0         \n",
      "_________________________________________________________________\n",
      "Generator (Sequential)       (None, 41)                30641     \n",
      "_________________________________________________________________\n",
      "Discriminator (Sequential)   (None, 1)                 58751     \n",
      "=================================================================\n",
      "Total params: 89,392\n",
      "Trainable params: 30,641\n",
      "Non-trainable params: 58,751\n",
      "_________________________________________________________________\n",
      "None\n",
      "Discriminator accuracy on Fake : 0.9568462594371997, Real : 0.998541523678792\n",
      "Discriminator accuracy on Fake : 0.9247597803706246, Real : 0.9942518874399451\n",
      "Discriminator accuracy on Fake : 0.9287062457103638, Real : 0.9849004804392587\n",
      "Discriminator accuracy on Fake : 0.8803191489361702, Real : 0.9669698009608785\n",
      "Discriminator accuracy on Fake : 0.8816918325326012, Real : 0.9187542896362388\n",
      "finished 0ne\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "dense (Dense)                (None, 50)                1650      \n",
      "_________________________________________________________________\n",
      "dense_1 (Dense)              (None, 50)                2550      \n",
      "_________________________________________________________________\n",
      "dense_2 (Dense)              (None, 100)               5100      \n",
      "_________________________________________________________________\n",
      "dense_3 (Dense)              (None, 150)               15150     \n",
      "_________________________________________________________________\n",
      "dense_4 (Dense)              (None, 41)                6191      \n",
      "=================================================================\n",
      "Total params: 30,641\n",
      "Trainable params: 30,641\n",
      "Non-trainable params: 0\n",
      "_________________________________________________________________\n",
      "None\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "dense_5 (Dense)              (None, 200)               8400      \n",
      "_________________________________________________________________\n",
      "dense_6 (Dense)              (None, 150)               30150     \n",
      "_________________________________________________________________\n",
      "dense_7 (Dense)              (None, 100)               15100     \n",
      "_________________________________________________________________\n",
      "dense_8 (Dense)              (None, 50)                5050      \n",
      "_________________________________________________________________\n",
      "dense_9 (Dense)              (None, 1)                 51        \n",
      "=================================================================\n",
      "Total params: 117,502\n",
      "Trainable params: 58,751\n",
      "Non-trainable params: 58,751\n",
      "_________________________________________________________________\n",
      "None\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "input_1 (InputLayer)         (None, 32)                0         \n",
      "_________________________________________________________________\n",
      "Generator (Sequential)       (None, 41)                30641     \n",
      "_________________________________________________________________\n",
      "Discriminator (Sequential)   (None, 1)                 58751     \n",
      "=================================================================\n",
      "Total params: 89,392\n",
      "Trainable params: 30,641\n",
      "Non-trainable params: 58,751\n",
      "_________________________________________________________________\n",
      "None\n",
      "Discriminator accuracy on Fake : 0.0, Real : 1.0\n",
      "Discriminator accuracy on Fake : 0.0, Real : 1.0\n",
      "Discriminator accuracy on Fake : 0.0, Real : 1.0\n",
      "Discriminator accuracy on Fake : 0.0, Real : 1.0\n",
      "Discriminator accuracy on Fake : 0.0, Real : 1.0\n",
      "finished 0ne\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "dense (Dense)                (None, 50)                1650      \n",
      "_________________________________________________________________\n",
      "dense_1 (Dense)              (None, 50)                2550      \n",
      "_________________________________________________________________\n",
      "dense_2 (Dense)              (None, 100)               5100      \n",
      "_________________________________________________________________\n",
      "dense_3 (Dense)              (None, 150)               15150     \n",
      "_________________________________________________________________\n",
      "dense_4 (Dense)              (None, 41)                6191      \n",
      "=================================================================\n",
      "Total params: 30,641\n",
      "Trainable params: 30,641\n",
      "Non-trainable params: 0\n",
      "_________________________________________________________________\n",
      "None\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "dense_5 (Dense)              (None, 200)               8400      \n",
      "_________________________________________________________________\n",
      "dense_6 (Dense)              (None, 150)               30150     \n",
      "_________________________________________________________________\n",
      "dense_7 (Dense)              (None, 100)               15100     \n",
      "_________________________________________________________________\n",
      "dense_8 (Dense)              (None, 50)                5050      \n",
      "_________________________________________________________________\n",
      "dense_9 (Dense)              (None, 1)                 51        \n",
      "=================================================================\n",
      "Total params: 117,502\n",
      "Trainable params: 58,751\n",
      "Non-trainable params: 58,751\n",
      "_________________________________________________________________\n",
      "None\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "input_1 (InputLayer)         (None, 32)                0         \n",
      "_________________________________________________________________\n",
      "Generator (Sequential)       (None, 41)                30641     \n",
      "_________________________________________________________________\n",
      "Discriminator (Sequential)   (None, 1)                 58751     \n",
      "=================================================================\n",
      "Total params: 89,392\n",
      "Trainable params: 30,641\n",
      "Non-trainable params: 58,751\n",
      "_________________________________________________________________\n",
      "None\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Discriminator accuracy on Fake : 0.0835621139327385, Real : 0.9957103637611531\n",
      "Discriminator accuracy on Fake : 0.983270418668497, Real : 0.9274193548387096\n",
      "Discriminator accuracy on Fake : 0.5879375428963624, Real : 0.9275909402882636\n",
      "Discriminator accuracy on Fake : 0.04649965682910089, Real : 0.9981125600549073\n",
      "Discriminator accuracy on Fake : 0.002916952642415923, Real : 0.9961393273850377\n",
      "finished 0ne\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "dense (Dense)                (None, 50)                1650      \n",
      "_________________________________________________________________\n",
      "dense_1 (Dense)              (None, 50)                2550      \n",
      "_________________________________________________________________\n",
      "dense_2 (Dense)              (None, 100)               5100      \n",
      "_________________________________________________________________\n",
      "dense_3 (Dense)              (None, 150)               15150     \n",
      "_________________________________________________________________\n",
      "dense_4 (Dense)              (None, 41)                6191      \n",
      "=================================================================\n",
      "Total params: 30,641\n",
      "Trainable params: 30,641\n",
      "Non-trainable params: 0\n",
      "_________________________________________________________________\n",
      "None\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "dense_5 (Dense)              (None, 200)               8400      \n",
      "_________________________________________________________________\n",
      "dense_6 (Dense)              (None, 150)               30150     \n",
      "_________________________________________________________________\n",
      "dense_7 (Dense)              (None, 100)               15100     \n",
      "_________________________________________________________________\n",
      "dense_8 (Dense)              (None, 50)                5050      \n",
      "_________________________________________________________________\n",
      "dense_9 (Dense)              (None, 1)                 51        \n",
      "=================================================================\n",
      "Total params: 117,502\n",
      "Trainable params: 58,751\n",
      "Non-trainable params: 58,751\n",
      "_________________________________________________________________\n",
      "None\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "input_1 (InputLayer)         (None, 32)                0         \n",
      "_________________________________________________________________\n",
      "Generator (Sequential)       (None, 41)                30641     \n",
      "_________________________________________________________________\n",
      "Discriminator (Sequential)   (None, 1)                 58751     \n",
      "=================================================================\n",
      "Total params: 89,392\n",
      "Trainable params: 30,641\n",
      "Non-trainable params: 58,751\n",
      "_________________________________________________________________\n",
      "None\n",
      "Discriminator accuracy on Fake : 1.0, Real : 0.08261839396019217\n",
      "Discriminator accuracy on Fake : 1.0, Real : 0.2814859299931366\n",
      "Discriminator accuracy on Fake : 1.0, Real : 0.3959334248455731\n",
      "Discriminator accuracy on Fake : 1.0, Real : 0.45821894303363075\n",
      "Discriminator accuracy on Fake : 1.0, Real : 0.4977693891557996\n",
      "finished 0ne\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "dense (Dense)                (None, 50)                1650      \n",
      "_________________________________________________________________\n",
      "dense_1 (Dense)              (None, 50)                2550      \n",
      "_________________________________________________________________\n",
      "dense_2 (Dense)              (None, 100)               5100      \n",
      "_________________________________________________________________\n",
      "dense_3 (Dense)              (None, 150)               15150     \n",
      "_________________________________________________________________\n",
      "dense_4 (Dense)              (None, 41)                6191      \n",
      "=================================================================\n",
      "Total params: 30,641\n",
      "Trainable params: 30,641\n",
      "Non-trainable params: 0\n",
      "_________________________________________________________________\n",
      "None\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "dense_5 (Dense)              (None, 200)               8400      \n",
      "_________________________________________________________________\n",
      "dense_6 (Dense)              (None, 150)               30150     \n",
      "_________________________________________________________________\n",
      "dense_7 (Dense)              (None, 100)               15100     \n",
      "_________________________________________________________________\n",
      "dense_8 (Dense)              (None, 50)                5050      \n",
      "_________________________________________________________________\n",
      "dense_9 (Dense)              (None, 1)                 51        \n",
      "=================================================================\n",
      "Total params: 117,502\n",
      "Trainable params: 58,751\n",
      "Non-trainable params: 58,751\n",
      "_________________________________________________________________\n",
      "None\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "input_1 (InputLayer)         (None, 32)                0         \n",
      "_________________________________________________________________\n",
      "Generator (Sequential)       (None, 41)                30641     \n",
      "_________________________________________________________________\n",
      "Discriminator (Sequential)   (None, 1)                 58751     \n",
      "=================================================================\n",
      "Total params: 89,392\n",
      "Trainable params: 30,641\n",
      "Non-trainable params: 58,751\n",
      "_________________________________________________________________\n",
      "None\n",
      "Discriminator accuracy on Fake : 0.7799416609471517, Real : 0.9293925875085792\n",
      "Discriminator accuracy on Fake : 0.6086993822923816, Real : 0.964910775566232\n",
      "Discriminator accuracy on Fake : 0.4906485929993137, Real : 0.9756348661633494\n",
      "Discriminator accuracy on Fake : 0.2711908030199039, Real : 0.9810398078242965\n",
      "Discriminator accuracy on Fake : 0.17004118050789294, Real : 0.9820693205216198\n",
      "finished 0ne\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "dense (Dense)                (None, 50)                1650      \n",
      "_________________________________________________________________\n",
      "dense_1 (Dense)              (None, 50)                2550      \n",
      "_________________________________________________________________\n",
      "dense_2 (Dense)              (None, 100)               5100      \n",
      "_________________________________________________________________\n",
      "dense_3 (Dense)              (None, 150)               15150     \n",
      "_________________________________________________________________\n",
      "dense_4 (Dense)              (None, 41)                6191      \n",
      "=================================================================\n",
      "Total params: 30,641\n",
      "Trainable params: 30,641\n",
      "Non-trainable params: 0\n",
      "_________________________________________________________________\n",
      "None\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "dense_5 (Dense)              (None, 200)               8400      \n",
      "_________________________________________________________________\n",
      "dense_6 (Dense)              (None, 150)               30150     \n",
      "_________________________________________________________________\n",
      "dense_7 (Dense)              (None, 100)               15100     \n",
      "_________________________________________________________________\n",
      "dense_8 (Dense)              (None, 50)                5050      \n",
      "_________________________________________________________________\n",
      "dense_9 (Dense)              (None, 1)                 51        \n",
      "=================================================================\n",
      "Total params: 117,502\n",
      "Trainable params: 58,751\n",
      "Non-trainable params: 58,751\n",
      "_________________________________________________________________\n",
      "None\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "input_1 (InputLayer)         (None, 32)                0         \n",
      "_________________________________________________________________\n",
      "Generator (Sequential)       (None, 41)                30641     \n",
      "_________________________________________________________________\n",
      "Discriminator (Sequential)   (None, 1)                 58751     \n",
      "=================================================================\n",
      "Total params: 89,392\n",
      "Trainable params: 30,641\n",
      "Non-trainable params: 58,751\n",
      "_________________________________________________________________\n",
      "None\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Discriminator accuracy on Fake : 1.0, Real : 0.950754975978037\n",
      "Discriminator accuracy on Fake : 1.0, Real : 0.9491249142072752\n",
      "Discriminator accuracy on Fake : 1.0, Real : 0.8940459849004805\n",
      "Discriminator accuracy on Fake : 1.0, Real : 0.9463795470144132\n",
      "Discriminator accuracy on Fake : 1.0, Real : 0.9405456417295813\n",
      "finished 0ne\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "dense (Dense)                (None, 50)                1650      \n",
      "_________________________________________________________________\n",
      "dense_1 (Dense)              (None, 50)                2550      \n",
      "_________________________________________________________________\n",
      "dense_2 (Dense)              (None, 100)               5100      \n",
      "_________________________________________________________________\n",
      "dense_3 (Dense)              (None, 150)               15150     \n",
      "_________________________________________________________________\n",
      "dense_4 (Dense)              (None, 41)                6191      \n",
      "=================================================================\n",
      "Total params: 30,641\n",
      "Trainable params: 30,641\n",
      "Non-trainable params: 0\n",
      "_________________________________________________________________\n",
      "None\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "dense_5 (Dense)              (None, 200)               8400      \n",
      "_________________________________________________________________\n",
      "dense_6 (Dense)              (None, 150)               30150     \n",
      "_________________________________________________________________\n",
      "dense_7 (Dense)              (None, 100)               15100     \n",
      "_________________________________________________________________\n",
      "dense_8 (Dense)              (None, 50)                5050      \n",
      "_________________________________________________________________\n",
      "dense_9 (Dense)              (None, 1)                 51        \n",
      "=================================================================\n",
      "Total params: 117,502\n",
      "Trainable params: 58,751\n",
      "Non-trainable params: 58,751\n",
      "_________________________________________________________________\n",
      "None\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "input_1 (InputLayer)         (None, 32)                0         \n",
      "_________________________________________________________________\n",
      "Generator (Sequential)       (None, 41)                30641     \n",
      "_________________________________________________________________\n",
      "Discriminator (Sequential)   (None, 1)                 58751     \n",
      "=================================================================\n",
      "Total params: 89,392\n",
      "Trainable params: 30,641\n",
      "Non-trainable params: 58,751\n",
      "_________________________________________________________________\n",
      "None\n",
      "Discriminator accuracy on Fake : 0.9997426218256692, Real : 0.9940803019903912\n",
      "Discriminator accuracy on Fake : 0.9900480439258751, Real : 0.9781228551818806\n",
      "Discriminator accuracy on Fake : 0.6624914207275223, Real : 0.9179821551132464\n",
      "Discriminator accuracy on Fake : 0.9936513383665065, Real : 0.7801132463967055\n",
      "Discriminator accuracy on Fake : 0.9899622512010982, Real : 0.6796499656829101\n",
      "finished 0ne\n"
     ]
    }
   ],
   "source": [
    "k = []\n",
    "for ep in ephocs:\n",
    "    for lr in learning_rates:\n",
    "        for op in optimizers:\n",
    "            for ac in activation_func:\n",
    "                arguments = [32, ep, 300,ep_d, ep_g, 50,lr, 4 ,op ,ac]\n",
    "                res = training1(arguments,x)\n",
    "                print(\"Saving results to file....\")\n",
    "                comb_model = res[\"combined_model\"]\n",
    "                comb_model.save(f'model{ep}_{lr}_{op}_{ac}.h5')\n",
    "                k.append(res)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
